import { Login } from "@/api/interface/index";
import {ResultEnum} from "@/enums/httpEnum"


/**
 * @name 登录模块
 */
export const pass = (params:Login.PassReq) => {
    return  new Promise((res)=>{
        setTimeout(()=>{
            if(params.username === "17325764719" && params.password === "123456" ){
                res({code:ResultEnum.SUCCESS,msg:'登录成功',data:{
                    'avatar' : '/images/user-avatar.png',
                    'token':"123123123",
                    'user_id' : "202301070111111",
                    'order_num' : 3000,
                    'order_price' : 1888888,
                   }
           });
            }else{
                res({code:ResultEnum.ERROR,msg:'账号密码错误',data:[]});
            }
        },2000);
    });
};
export const sms = (params:Login.SmsReq) => {
    return  new Promise((res)=>{
        setTimeout(()=>{
            if(params.phone === "17325764719" && params.captcha === "abcde" ){
                res({code:ResultEnum.SUCCESS,msg:'登录成功',data:{
                    'avatar' : '/images/user-avatar.png',
                    'token':"123123123",
                    'user_id' : "202301070111111",
                    'order_num' : 3000,
                    'order_price' : 1888888,
                   }
           });
            }else{
                res({code:ResultEnum.ERROR,msg:'验证码错误',data:[]});
            }
        },2000);
    });
};

